package designmode.factory;

/**
 * Created by Administrator on 2017/10/31 031.
 */
public class PizzaStore
{
    SimplePizzaFactory factory;

    public PizzaStore(SimplePizzaFactory factory)
    {
        this.factory = factory;
    }

    public Pizza orderPizza(String type)
    {
        Pizza p = factory.createPizza(type);

        p.prepare();
        p.bake();
        p.cut();
        p.box();
        return p;
    }
}
